package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 教室资源表
 * @TableName classroom_resource
 */
@TableName(value ="classroom_resource")
@Data
public class ClassroomResource {
    /**
     * 教室ID
     */
    @TableId(type = IdType.AUTO)
    private Long classroomId;

    /**
     * 教室编号
     */
    private String classroomCode;

    /**
     * 校区
     */
    private String campus;

    /**
     * 楼宇名称
     */
    private String building;

    /**
     * 楼层
     */
    private Integer floor;

    /**
     * 容量
     */
    private Integer capacity;

    /**
     * 教室类型
     */
    private Object classroomType;

    /**
     * 设备清单（JSON格式）
     */
    private Object equipmentList;

    /**
     * 状态
     */
    private Object status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ClassroomResource other = (ClassroomResource) that;
        return (this.getClassroomId() == null ? other.getClassroomId() == null : this.getClassroomId().equals(other.getClassroomId()))
            && (this.getClassroomCode() == null ? other.getClassroomCode() == null : this.getClassroomCode().equals(other.getClassroomCode()))
            && (this.getCampus() == null ? other.getCampus() == null : this.getCampus().equals(other.getCampus()))
            && (this.getBuilding() == null ? other.getBuilding() == null : this.getBuilding().equals(other.getBuilding()))
            && (this.getFloor() == null ? other.getFloor() == null : this.getFloor().equals(other.getFloor()))
            && (this.getCapacity() == null ? other.getCapacity() == null : this.getCapacity().equals(other.getCapacity()))
            && (this.getClassroomType() == null ? other.getClassroomType() == null : this.getClassroomType().equals(other.getClassroomType()))
            && (this.getEquipmentList() == null ? other.getEquipmentList() == null : this.getEquipmentList().equals(other.getEquipmentList()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getClassroomId() == null) ? 0 : getClassroomId().hashCode());
        result = prime * result + ((getClassroomCode() == null) ? 0 : getClassroomCode().hashCode());
        result = prime * result + ((getCampus() == null) ? 0 : getCampus().hashCode());
        result = prime * result + ((getBuilding() == null) ? 0 : getBuilding().hashCode());
        result = prime * result + ((getFloor() == null) ? 0 : getFloor().hashCode());
        result = prime * result + ((getCapacity() == null) ? 0 : getCapacity().hashCode());
        result = prime * result + ((getClassroomType() == null) ? 0 : getClassroomType().hashCode());
        result = prime * result + ((getEquipmentList() == null) ? 0 : getEquipmentList().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", classroomId=").append(classroomId);
        sb.append(", classroomCode=").append(classroomCode);
        sb.append(", campus=").append(campus);
        sb.append(", building=").append(building);
        sb.append(", floor=").append(floor);
        sb.append(", capacity=").append(capacity);
        sb.append(", classroomType=").append(classroomType);
        sb.append(", equipmentList=").append(equipmentList);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}